package com.gitee.ixtf.rsocket.service

import com.gitee.ixtf.core.J
import io.cloudevents.CloudEvent
import io.cloudevents.core.builder.CloudEventBuilder
import java.net.URI

object PingRequest {
  const val CLOUD_EVENT_TYPE = "ce:rsocket:PingRequest"

  fun cloudEvent(source: String): CloudEvent =
      CloudEventBuilder.v1()
          .withId(J.objectId())
          .withSource(URI(source))
          .withType(CLOUD_EVENT_TYPE)
          .build()
}

const val PONG = "Pong"
